Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 5 - Bitmap Shapes / Bitmap Shapes Reference
Functions / Checking Bitmap Colors


GXCheckBitmapColor

You can use the GXCheckBitmapColor function to determine whether the color values in a bitmap's pixel image are in the gamut of a given color space or exactly match colors in a given color set.

gxShape GXCheckBitmapColor(gxShape source, 
                           const gxLongRectangle *area,
                           gxColorSpace space, gxColorSet aSet,
                           gxColorProfile profile);
source
A reference to the bitmap shape whose pixels you want to check.
area
A pointer to a long rectangle specifying the area of the bitmap to check. You can specify a value of nil for this parameter to check the entire bitmap.
space
The color space to check the pixel values of the source bitmap against. You can specify the gxIndexedSpace color space to indicate that you want to test the pixel values against a color set.
aSet
A reference to the color set to check the pixel values of the source bitmap against.
profile
A pointer to the color profile to use when checking the pixel values of the source bitmap.
function result
A new bitmap shape with a pixel size of 1 bit per pixel. The value of each
pixel in this bitmap indicates whether the color of the corresponding pixel in the source bitmap lies in the gamut of the specified color space (or, if you specified a color set, whether the color of the corresponding pixel exactly matches a color in that color set). If the corresponding source pixel does lie in the gamut of the color space (or match a color in the color set), the pixel value of this bitmap is set to 0, otherwise it is 1.
DESCRIPTION
The GXCheckBitmapColor function performs one of two tests on the pixels of the source bitmap:

If you specify nil as the area parameter, this function tests every pixel in the source bitmap's pixel image. If you provide a pointer to a long rectangle in this parameter, the function only tests the pixels that fall within the corresponding rectangular subsection of the source bitmap.

This function returns as the function result a 1 bit-per-pixel bitmap shape with a bitmap height and bitmap width corresponding to the dimensions of the area parameter. Each pixel in the returned bitmap is set to a value of 0 if the corresponding pixel in the source bitmap passed the test. The pixel value is 1 otherwise.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
color_is_nil 
colorSpace_out_of_range(debugging version)
Warnings 
colorSet_index_out_of_range(debugging version)
SEE ALSO
For information about the gxLongRectangle structure, see page 5-64.

For information about colors, color spaces, color sets, color profiles, and the GXCheckColor function, see chapter "Colors and Color-Related Objects" in Inside Macintosh: QuickDraw GX Objects.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help